package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

@Data
public class LeaseException extends RuntimeException {

  private Integer code;

  /**
   * @param message 错误信息
   * @param code 错误码
   * */
  public LeaseException(String message,Integer code) {
    super(message);
    this.code = code;
  }

  public LeaseException(ResultCodeEnum resultCodeEnum) {
   super(resultCodeEnum.getMessage());
   this.code = resultCodeEnum.getCode();
  }

}
